package com.miui.theme.custom.viewmodel

import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.miui.theme.custom.data.ConfigDataStore
import com.miui.theme.custom.data.DatabaseConfig
import kotlinx.coroutines.launch

class ConfigViewModel(private val configDataStore: ConfigDataStore) : ViewModel() {
    val configFlow = configDataStore.config

    fun saveConfig(config: DatabaseConfig) {
        viewModelScope.launch {
            configDataStore.saveConfig(config)
        }
    }
}